package cn.yj.cgs.dba.mapper;

import cn.yj.annotation.pagehelper.annotation.StartPage;
import cn.yj.annotation.pagehelper.page.Page;
import cn.yj.cgs.dba.entity.Comment;
import cn.yj.cgs.dba.entity.vo.CommentVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 永健
 * @since 2019-02-23
 */
public interface CommentMapper extends BaseMapper<Comment> {
    @StartPage
    List<CommentVo> findList(@Param("map") Map<String, Object> map, @Param("page") Page<CommentVo> page);


    Comment selectByIdForUpdate(String commentNo);

    int incrOneGoodCountByNo(String commentNo);

    List<CommentVo> findByArticleNo(@Param("map") Map<String, Object> map, @Param("page") Page<CommentVo> page);

    List<CommentVo> findSonByArticleNoAndPId(
            @Param("articleNo") String articleNo, @Param("parentId") Integer parentId,
            @Param("userCode") String userCode);


    int selectAllCommentCount(String articleNo);
}
